package com.crm.system.service.cluePoolManager;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.crm.common.model.DhPageInfo;
import com.crm.model.entity.cluePoolManager.CluePoolCompany;
import com.crm.model.entity.cluePoolManager.CluePoolCompanyExample;
import com.crm.model.entity.sys.UserAccount;
import com.crm.model.qo.cluePoolManager.CluePoolOpenSeaQO;
import com.crm.model.vo.cluePoolManager.CluePoolCompanyOpenSeaVO;
import com.crm.model.vo.cluePoolManager.CluePoolCompanyVO;
import com.crm.model.vo.cluePoolManager.CluePoolPubliclOpenSeaVO;

import java.util.List;
import java.util.Map;

/**
 * @author luojie
 * @date 2020/12/25 14:57
 */
public interface CluePoolCompanyService {

    /**
     * 添加线索池公司表
     * @param companyIdList
     * @param cluePoolId
     * @return
     */
    Boolean addPoolCompany(List<String> companyIdList,String cluePoolId);

    /**
     * @author wll
     * info 用户模块-线索池管理-线索池公海表单(公司 我参与的)
     * @return
     */
    DhPageInfo<CluePoolPubliclOpenSeaVO> getCluePoolCompanyInfo(CluePoolOpenSeaQO cluePoolOpenSeaQO, Integer pageIndex, Integer pageSize, String sortName, String sortOrder, List<CluePoolCompany> cluePoolCompanies, UserAccount userAccount);

    /**
     * 私有池查询使用组人员
     * @param cluePollId   ---线索池主键
     * @return
     */
    List<Map<String, Object>> selectPersonByDistributePermission(String cluePollId);

    /**
     * 私有池查询使用组公司
     * @param cluePollId   ---线索池主键
     * @return
     */
    List<Map<String, Object>> selectCompanyByDistributePermission(String cluePollId);

    /**
     * 查询线索池个人使用权限
     * @param cluePollId
     * @return
     */
    List<JSONObject> selectPoolPersonalPermission(String cluePollId);

    /**
     * 查询线索池公司使用组权限
     */
    List<JSONObject> selectPoolCompanyPermission(String cluePollId);


    List<CluePoolCompany> selectByExample(CluePoolCompanyExample cluePoolCompanyExample);

    /**
     * 删除使用组用户权限
     * @param cluePoolId
     * @param permissionType
     * @return
     */
    Boolean deleteUsePeople(String cluePoolId,String permissionType);

    /**
     * 权限与详情-添加公司及使用人员使用权限
     * @param cluePoolId
     * @param usePeopleList
     * @return
     */
    Boolean addUsePeople(String cluePoolId,List<JSONObject> usePeopleList);

    /**
     * 权限与详情-添加公司使用权限
     * @return
     */
    Boolean addUserCompany(String cluePoolId,List<String> companyIdList);

    /**
     * 添加创建人使用公司
     * @param cluePoolId
     * @return
     */
    Boolean addCreatePeopleCompany(String cluePoolId);

    /**
     * 添加创建人使用公司
     * @param cluePoolId
     * @return
     */
    List<CluePoolCompany> selectCompanyByPoolId(String cluePoolId);

}
